package top.canyue.eca_manager.provider;

import top.canyue.eca_manager.bean.User;

public class UserProvider {
    public String updateUserInfo(User user) {
        StringBuilder sql = new StringBuilder();
        sql.append("UPDATE user SET ");
        if (user.getName() != null) {
            sql.append("name = #{name},");
        }
        if (user.getPhone() != null) {
            sql.append("phone = #{phone},");
        }
        sql.append("updateTime = NOW() ");
        sql.append("WHERE id = #{id}");
        return sql.toString();
    }
}
